package com.woniu.backstage.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniu.backstage.entity.TbInform;
import com.woniu.backstage.entity.TbUser;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author spirit
 * @since 2020-04-18
 */
public interface TbInformMapper extends BaseMapper<TbInform> {
    @Select("select * from tb_inform join tb_user on tb_inform.user_id = tb_user.id limit #{begin},#{pageSize}")
    List<TbInform> getAllInform(@Param("begin") Integer begin, @Param("pageSize") Integer pageSize);

    /**
     * 查询总的数据条数
     * @return  总的数据条数
     */
    @Select("select count(*) from tb_inform")
    Integer getTotal();
    /**
     * 批量删除系统消息
     */
    Integer deleteBatch(@Param("idArr") List<Integer> idArr);

}
